package com.usian.springbootmysql.controller;

import com.usian.springbootmysql.pojo.ResultVo;
import com.usian.springbootmysql.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("user")
public class LoginController {

    @Autowired
    private LoginService loginService;


    @RequestMapping("send")
    public ResultVo login(String phone) throws Exception {
         return loginService.sendCode(phone);

    }
    @RequestMapping("userLogin")
    public ResultVo userLogin(String phone,String code) throws Exception {
        return loginService.userLogin(phone,code);

    }
}
